﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Wormhole.Engine.Communication
{
	#region Actions
	/// <summary>
	/// The actions that can be send over communications.
	/// </summary>
	public enum Actions
	{
		GameList = 101,
		GameListRequest = 102,

		RandomSeed = 201,

		NewDeck = 301,
		ContinueDeck = 302,
		EndDeck = 303,

		RequestJoin = 401,
		AcceptJoin = 402,
		RejectJoin = 403,

		GameClosed = 501,

		KeepHand = 601,
		TakeMulligan = 602,

		CardAction = 701,
		GameAction = 702
	}
	#endregion

	#region Action Convertor
	///// <summary>
	///// This class is used to convert representations of actions going across the wire.
	///// </summary>
	//public static class ActionConvertor
	//{
	//    #region Convert to Int32
	//    /// <summary>
	//    /// Convert an action to its integer representation.
	//    /// </summary>
	//    /// <param name="action">The action to be converted.</param>
	//    /// <returns>The Int32 representation of the action.</returns>
	//    public static int ToInt32(Actions action)
	//    {
	//        return (int)action;
	//    }
	//    #endregion

	//    #region Convert From Int32
	//    /// <summary>
	//    /// Convert the integer representation of an action to its enumuration type.
	//    /// </summary>
	//    /// <param name="action">The action to convert.</param>
	//    /// <returns>Returns the integer representation.</returns>
	//    public static Actions FromInt32(int action)
	//    {
	//        return ActionConvertor.FromString(action.ToString());
	//    }
	//    #endregion
		
	//    #region Convert To String
	//    /// <summary>
	//    /// Convert the action to its string representation.
	//    /// </summary>
	//    /// <param name="action">The action to be converted.</param>
	//    /// <returns>The string representation of the action.</returns>
	//    public static string ToString(Actions action)
	//    {
	//        return ActionConvertor.ToInt32(action).ToString();
	//    }
	//    #endregion

	//    #region Convert From String
	//    /// <summary>
	//    /// Convert a string representation of an action to its enumuration type.
	//    /// </summary>
	//    /// <param name="action"></param>
	//    /// <returns></returns>
	//    public static Actions FromString(string action)
	//    {
	//        return (Actions)Enum.Parse(typeof(Actions), action, true);
	//    }
	//    #endregion
	//}
	#endregion
}
